﻿<%@ Control Language="C#" AutoEventWireup="true" Codebehind="AlbumManager.ascx.cs"
    Inherits="NCS.Module.Multimedia.Admin.Video.AlbumManager" %>
<%@ Register Src="../UserControls/Editor.ascx" TagName="Editor" TagPrefix="uc1" %>
<%@ Register Assembly="NCS.Library" Namespace="NCS.Library.Controls" TagPrefix="cc1" %>
<%@ Register Assembly="NCS.FilePickerControl" Namespace="NCS.FilePicker" TagPrefix="cc2" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>
<script runat="server">

    protected void dtgAlbumList_Sorting(object sender, GridViewSortEventArgs e)
    {

    }

    protected void dtgAlbumList_RowEditing(object sender, GridViewEditEventArgs e)
    {

    }
</script>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="tableGrid" runat="server">
    <tr>
        <td style="width: 100%;">
            <cc1:GridView ID="dtgAlbumList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                BorderColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px" CellPadding="2"
                CssClass="Grid" PageSize="15" Width="100%" OnRowCommand="dtgAlbumList_RowCommand"
                OnRowDataBound="dtgAlbumList_RowDataBound" OnRowEditing="dtgAlbumList_RowEditing" OnRowDeleting="dtgAlbumList_RowDeleting"
                OnSelectedIndexChanged="dtgAlbumList_SelectedIndexChanged">
                <AlternatingRowStyle CssClass="Grid_Raw2" Height="40" />
                <RowStyle CssClass="Grid_Raw1" Height="40 " />
                <HeaderStyle Font-Bold="True" CssClass="Grid_Top"></HeaderStyle>
                <Columns>
                    <asp:BoundField Visible="True" DataField="AlbumID" HeaderText="ID">
                        <headerstyle width="30px"></headerstyle>
                    </asp:BoundField>
                  
                    <asp:TemplateField HeaderText="T&#234;n Album">
                        <headerstyle horizontalalign="Center"></headerstyle>
                        <itemtemplate>
							<div style="padding-left:3px; padding-right:5px;"><asp:HyperLink ID="lnkHeadline" runat="server"></asp:HyperLink></div>
						</itemtemplate>
                    </asp:TemplateField>
                    <asp:TemplateField Visible="True">
                        <headerstyle horizontalalign="Center" width="120px"></headerstyle>
                        <itemstyle horizontalalign="Center"></itemstyle>
                        <headertemplate>
							<asp:Button ID="cmdupdatestatus" CausesValidation="false" runat="server" Width="80" CommandName="updatestatus"
								CssClass="Button" Text="Trạng thái"></asp:Button>
						</headertemplate>
                        <itemtemplate>
							<asp:DropDownList ID="dropStatus" runat="server" Width="80" >
							    <asp:ListItem Text="Ẩn" Value="0"></asp:ListItem>
							    <asp:ListItem Text="Hiển thị" Value="1"></asp:ListItem>
							</asp:DropDownList>
						</itemtemplate>
                    </asp:TemplateField>
                    <asp:TemplateField Visible="False">
                        <headerstyle horizontalalign="Center" width="70px"></headerstyle>
                        <itemstyle horizontalalign="Center"></itemstyle>
                        <headertemplate>
							<asp:Button ID="cmdUpdateIndex" CausesValidation="false" runat="server" Width="60" CommandName="updatepriority"
								CssClass="Button" Text="Thứ tự"></asp:Button>
						</headertemplate>
                        <itemtemplate>
							<asp:DropDownList ID="dropIndex" runat="server" Width="60">
							</asp:DropDownList>
						</itemtemplate>
                    </asp:TemplateField>
                    <asp:TemplateField Visible="False">
                        <headerstyle horizontalalign="Center" width="120px"></headerstyle>
                        <itemstyle horizontalalign="Center"></itemstyle>
                        <headertemplate>
							<asp:Button ID="cmdupdaterank" CausesValidation="false" runat="server" Width="60" CommandName="updaterank"
								CssClass="Button" Text="Loại Album"></asp:Button>
						</headertemplate>
                        <itemtemplate>
							<asp:DropDownList ID="dropRank" runat="server" Width="80" >
							    <asp:ListItem Text="Bình thường" Value="1"></asp:ListItem>
							    <asp:ListItem Text="Nổi bật" Value="2"></asp:ListItem>
							</asp:DropDownList>
						</itemtemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Thao t&#225;c">
                        <headerstyle horizontalalign="Center" width="150px"></headerstyle>
                        <itemstyle horizontalalign="Center"></itemstyle>
                        <itemtemplate>
                        							
							<asp:Button ID="cmdEdit" CausesValidation="false" runat="server" CssClass="Button" CommandName="edit"
								Text="Sửa" CommandArgument='<%# Eval("AlbumID") %>'></asp:Button>
							<asp:Button ID="cmdDel" CausesValidation="false" runat="server" CssClass="Button" CommandName="delete"
								Text="Xóa" CommandArgument='<%# Eval("AlbumID") %>' OnClientClick="return confirm('Bạn có chắc chắn?');"></asp:Button>									
							<asp:hyperlink Visible="False" runat=server id="hplComment" CssClass="lightwindow page-options" params="lightwindow_type=external,lightwindow_width=800,lightwindow_height=350">Lời bình</asp:hyperlink>
							
						</itemtemplate>
                    </asp:TemplateField>
                </Columns>
            </cc1:GridView>
        </td>
    </tr>
    <tr>
        <td  style="text-align: right; padding-right: 20px;">
    <asp:Button ID="btnthemmoi" runat="server" Text="Thêm Album mới" CssClass="Button"
        OnClick="btnthemmoi_Click" />
        </td>
    </tr>
</table>
<asp:Label ID="lbupdate" runat="server" Font-Bold="true" ForeColor="Red"></asp:Label>
<table border="0" cellpadding="5" cellspacing="3" id="tb_add" width="100%" runat="server" visible="false">
    <tr>
        <td colspan="2" align="center">
            </td>
    </tr>
    <tr>
        <td style="width: 120px">
            Tên Album &nbsp;&nbsp;
        </td>
        <td>
            <asp:TextBox ID="txtAlbumName" Width="100%" MaxLength="250" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Ảnh minh họa
        </td>
        <td>
            <cc2:FilePicker ID="txtAvatar" MaxLength="250" onkeypress="return false;" runat="server" fpPopupURL="/FilePicker/TUFilePicker.aspx"
                Width="90%"></cc2:FilePicker>
        </td>
    </tr>
    <tr>
        <td style="width: 120px;">
            Nội dung chi tiết</td>
        <td style="height: 410px">
            <uc1:Editor ID="Editor1" runat="server"></uc1:Editor>
        </td>
    </tr>
    <tr>
        <td style="height: 5px;" colspan="2">
        </td>
    </tr>
    <tr>
        <td>
        </td>
        <td>
            <asp:CheckBox Visible="false" ID="chkcomment" runat="server" Text="Cho đóng góp ý kiến" Checked="true" />
        </td>
    </tr>
    <tr>
        <td style="height: 5px;" colspan="2">
        </td>
    </tr>
    <tr>
        <td>
        </td>
        <td>
            <asp:CheckBox ID="chkalbum" Checked="true" runat="server" Text="Hiển thị" />
        </td>
    </tr>
    <tr>
        <td style="height: 5px;" colspan="2">
        </td>
    </tr>
    <tr>
        <td style="width: 84px">
            Loại album&nbsp;</td>
        <td>
            <asp:RadioButtonList ID="rdtype" RepeatDirection="horizontal" runat="server">
                <asp:ListItem Text="Bình thường" Value="1" Selected="true"></asp:ListItem>
                <asp:ListItem Text="Nổi bật" Value="2"></asp:ListItem>
            </asp:RadioButtonList>
        </td>
    </tr>
    <tr>
        <td style="height: 5px;" colspan="2">
        </td>
    </tr>
    <tr>
        <td style="width: 84px">
        </td>
        <td>
            <asp:Button ID="btnAdd" runat="server" CssClass="Button" Text="Thêm mới" OnClick="btnAdd_Click" />
            <asp:Button ID="btnUpdate" runat="server" CssClass="Button" Text="Cập nhật" OnClick="btnUpdate_Click" />
            <asp:Button ID="btnCancel" runat="server" CssClass="Button" Text="Quay lại" OnClick="btnCancel_Click" />
        </td>
    </tr>
</table>
<asp:HiddenField ID="hddID" runat="server" />
<asp:Panel ID="pnlHidden" runat="server" Visible="false">
    <tr style="display:none;">
        <td style="width: 84px">
            Album cha &nbsp;&nbsp;</td>
        <td>
            <asp:DropDownList ID="dropalbum" DataTextField="AlbumName" DataValueField="AlbumID"
                Width="100%" runat="server">
            </asp:DropDownList>
        </td>
    </tr>

</asp:Panel>